package com.example.vo;

import com.mybatisflex.annotation.RelationOneToMany;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.List;

/**
 * @author sunfayun
 * @version 1.0
 * @since 2023/10/17
 */
@Data
public class ProvinceAndCityVo {

    @Schema(description = "")
    private String id;

    /**
     * 省份名称
     */
    @Schema(description = "省份名称")
    private String name;

    @RelationOneToMany(selfField = "id", targetField = "pid", targetTable = "city")
    private List<CityVo> cityVoList;

    @Data
    public static class CityVo {
        /**
         * 城市名称
         */
        @Schema(description = "城市名称")
        private String name;

        /**
         * 省份id
         */
        @Schema(description = "省份id")
        private String pid;
    }

}
